package linkedin;

/**
 * Created by Tzachi on 27/10/2014.
 */
public class Power {
    public static int pow(int base, int exp) {
        int result = 1;
        while (exp != 0) {
            if ((exp & 1) != 0)
                result *= base;
            exp >>= 1;
            base *= base;
        }
        return result;
    }
}
